import 'dart:convert';

import '../enity/media_filter_type.dart';

class MockData {
  // typeJson 转换为 List<MediaFilterType>
  static List<MediaFilterType> typeJsonToList(String typeJson) {
    List<MediaFilterType> list = [];
    List<dynamic> jsonList = jsonDecode(typeJson);
    for (var item in jsonList) {
      list.add(MediaFilterType.fromJson(item));
    }
    return list;
  }

  String typeJson = '''
  [
    {
        "type": "mediaType",
        "name": "全部",
        "options": [
          {"optionId": "1", "optionName": "全部", "selected": true, "order": 0},
          {"optionId": "2", "optionName": "电影", "selected": false, "order": 1},
          {"optionId": "3", "optionName": "电视剧", "selected": false, "order": 2},
          {"optionId": "4", "optionName": "综艺", "selected": false, "order": 3},
          {"optionId": "5", "optionName": "动漫", "selected": false, "order": 4},
          {"optionId": "6", "optionName": "记录片", "selected": false, "order": 5}
        ]
      },
      {
        "type": "region",
        "name": "全部",
        "options": [
          {"optionId": "1", "optionName": "全部", "selected": true, "order": 0},
          {"optionId": "2", "optionName": "内地", "selected": false, "order": 1},
          {"optionId": "3", "optionName": "中国香港", "selected": false, "order": 2},
          {"optionId": "4", "optionName": "中国台湾", "selected": false, "order": 3},
          {"optionId": "5", "optionName": "美国", "selected": false, "order": 4},
          {"optionId": "6", "optionName": "韩国", "selected": false, "order": 5},
          {"optionId": "7", "optionName": "日本", "selected": false, "order": 6},
          {"optionId": "8", "optionName": "泰国", "selected": false, "order": 7},
          {"optionId": "9", "optionName": "印度", "selected": false, "order": 8},
          {"optionId": "10", "optionName": "英国", "selected": false, "order": 9},
          {"optionId": "11", "optionName": "法国", "selected": false, "order": 10},
          {"optionId": "12", "optionName": "德国", "selected": false, "order": 11},
          {"optionId": "13", "optionName": "意大利", "selected": false, "order": 12},
          {"optionId": "14", "optionName": "西班牙", "selected": false, "order": 13},
          {"optionId": "15", "optionName": "俄罗斯", "selected": false, "order": 14},
          {"optionId": "16", "optionName": "伊朗", "selected": false, "order": 15},
          {"optionId": "17", "optionName": "伊拉克", "selected": false, "order": 16},
          {"optionId": "18", "optionName": "阿富汗", "selected": false, "order": 17},
          {"optionId": "19", "optionName": "阿拉伯", "selected": false, "order": 18},
          {"optionId": "20", "optionName": "非洲", "selected": false, "order": 19},
          {"optionId": "21", "optionName": "其他", "selected": false, "order": 20}
        ]
      },
      {
        "type": "year",
        "name": "全部",
        "options": [
          {"optionId": "1", "optionName": "全部", "selected": true, "order": 0},
          {"optionId": "2", "optionName": "2022", "selected": false, "order": 1},
          {"optionId": "3", "optionName": "2021", "selected": false, "order": 2},
          {"optionId": "4", "optionName": "2020", "selected": false, "order": 3},
          {"optionId": "5", "optionName": "2019", "selected": false, "order": 4},
          {"optionId": "6", "optionName": "2018", "selected": false, "order": 5},
          {"optionId": "7", "optionName": "2017", "selected": false, "order": 6},
          {"optionId": "8", "optionName": "2016", "selected": false, "order": 7},
          {"optionId": "9", "optionName": "2015", "selected": false, "order": 8},
          {"optionId": "10", "optionName": "2014", "selected": false, "order": 9},
          {"optionId": "11", "optionName": "2013", "selected": false, "order": 10},
          {"optionId": "12", "optionName": "2012", "selected": false, "order": 11},
          {"optionId": "13", "optionName": "2011", "selected": false, "order": 12},
          {"optionId": "14", "optionName": "2010", "selected": false, "order": 13},
          {"optionId": "15", "optionName": "2009", "selected": false, "order": 14},
          {"optionId": "16", "optionName": "2008", "selected": false, "order": 15},
          {"optionId": "17", "optionName": "2007", "selected": false, "order": 16},
          {"optionId": "18", "optionName": "2006", "selected": false, "order": 16},
          {"optionId": "19", "optionName": "2005", "selected": false, "order": 16},
          {"optionId": "20", "optionName": "2004", "selected": false, "order": 16},
          {"optionId": "21", "optionName": "2003", "selected": false, "order": 16},
          {"optionId": "22", "optionName": "2002", "selected": false, "order": 16},
          {"optionId": "23", "optionName": "2001", "selected": false, "order": 16},
          {"optionId": "24", "optionName": "2000", "selected": false, "order": 16},
          {"optionId": "25", "optionName": "1999", "selected": false, "order": 16},
          {"optionId": "26", "optionName": "1998", "selected": false, "order": 16},
          {"optionId": "27", "optionName": "1997", "selected": false, "order": 16},
          {"optionId": "28", "optionName": "1996", "selected": false, "order": 16},
          {"optionId": "29", "optionName": "1995", "selected": false, "order": 16},
          {"optionId": "30", "optionName": "1994", "selected": false, "order": 16},
          {"optionId": "31", "optionName": "1993", "selected": false, "order": 16},
          {"optionId": "32", "optionName": "1992", "selected": false, "order": 16},
          {"optionId": "33", "optionName": "1991", "selected": false, "order": 16}
         ]
      },
      {
        "type": "type",
        "name": "全部",
        "options": [
          {"optionId": "1", "optionName": "全部", "selected": true, "order": 0},
          {"optionId": "2", "optionName": "动作片", "selected": false, "order": 1},
          {"optionId": "3", "optionName": "喜剧片", "selected": false, "order": 2},
          {"optionId": "4", "optionName": "爱情片", "selected": false, "order": 3},
          {"optionId": "5", "optionName": "科幻片", "selected": false, "order": 4},
          {"optionId": "6", "optionName": "战争片", "selected": false, "order": 5},
          {"optionId": "7", "optionName": "恐怖片", "selected": false, "order": 6},
          {"optionId": "8", "optionName": "动画片", "selected": false, "order": 7},
          {"optionId": "9", "optionName": "犯罪片", "selected": false, "order": 8},
          {"optionId": "10", "optionName": "剧情片", "selected": false, "order": 9},
          {"optionId": "11", "optionName": "悬疑片", "selected": false, "order": 10},
          {"optionId": "12", "optionName": "惊悚片", "selected": false, "order": 11},
          {"optionId": "13", "optionName": "纪录片", "selected": false, "order": 12},
          {"optionId": "14", "optionName": "音乐片", "selected": false, "order": 13},
          {"optionId": "15", "optionName": "情色片", "selected": false, "order": 14},
          {"optionId": "16", "optionName": "传记片", "selected": false, "order": 15},
          {"optionId": "17", "optionName": "历史片", "selected": false, "order": 16},
          {"optionId": "18", "optionName": "歌舞片", "selected": false, "order": 17},
          {"optionId": "19", "optionName": "舞台艺术片", "selected": false, "order": 18},
          {"optionId": "20", "optionName": "灾难片", "selected": false, "order": 19}
        ]
      },
      
      {
        "type": "sort",
        "name": "上映时间",
        "options": [
          {"optionId": "1", "optionName": "上映时间", "selected": true, "order": 0},
          {"optionId": "2", "optionName": "评分", "selected": false, "order": 1},
          {"optionId": "3", "optionName": "人气", "selected": false, "order": 2}
        ]
      }
  ]
  ''';
}
